package org.parademo.dao;

import org.apache.commons.lang.NotImplementedException;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.parademo.model.CountryEntity;

import java.util.List;

/**
 * @author ajit
 */
public class CountryDao extends GenericDao<CountryEntity> {

    public CountryDao(SessionFactory factory) {
        super(factory);
    }

    @SuppressWarnings("unchecked")
    public List<CountryEntity> getCountries() {
        Query query = getCurrentSession().createQuery(
                "from CountryEntity"
        );

        return query.list();
    }

}
